package com.itheima.group;


import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;


public class MyGroup extends WritableComparator {
    public MyGroup() {
        //告知分组组件k2是一个什么类型
        super(OrderBean.class,true);
    }

    @Override
    public int compare(WritableComparable a, WritableComparable b) {
        OrderBean a1=(OrderBean) a;
        OrderBean b1=(OrderBean) b;
        int i = a1.getOrderId().compareTo(b1.getOrderId());
        return i;
    }
}
